﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ThreeByte.ActiveDeck.Config;
using System.Windows.Forms.Integration;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using ThreeByte.ActiveDeck.AddIn.Controls;

namespace ThreeByte.ActiveDeck.Controls
{
    public partial class SetupUserResponseForm : Form
    {

        public PowerPoint.Slide SlideHint {
            get {
                return _userResponseControl.SlideHint;
            }
            set {
                _userResponseControl.SlideHint = value;
            }
        }

        private SetupUserResponseControl _userResponseControl;

        public SetupUserResponseForm(CoreConfig config, PowerPoint.Shape currentGraphic = null, bool isGrouped = false) {
            InitializeComponent();

            _userResponseControl = new SetupUserResponseControl(config, currentGraphic, isGrouped);
            _userResponseControl.Close += new EventHandler<DialogResultEventArgs>(userResponseControl_Close);
            
            //Add Setup Form
            ElementHost elementHost = new ElementHost();
            elementHost.Dock = DockStyle.Fill;
            elementHost.Location = new Point(0, 0);
            elementHost.Name = "elementHost";
            elementHost.Child = _userResponseControl;
            elementHost.AutoSize = true;
            this.Controls.Add(elementHost);

            
        }

        void userResponseControl_Close(object sender, DialogResultEventArgs e) {
            this.DialogResult = e.DialogResult;
        }

    }
}
